package com.itheima.controller;

import com.itheima.domain.User;
import com.itheima.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;

@Controller
@RequestMapping("/user")
public class UserController {
    @Autowired
    private UserService userService;
    //登录
    @RequestMapping("/login")
    public String login(String email,String password) throws Exception {
        System.out.println("login..."+email+","+password);
        User user = userService.findEAP(email,password);
        if(user!=null){
            return "main";
        }else{
            return "login";
        }

    }
}
